// by Xeno
private ["_vehicle"];
#include "x_setup.sqf"

#define __Poss _poss = x_sm_pos select 0;
#define __PossAndOther _poss = x_sm_pos select 0;_pos_other = x_sm_pos select 1;

x_sm_pos = [[1385.8,1601.16,0],[1388.18,1575.66,0]]; // index: 35,   Government member Isla de Libertad (attention, the AI is placed in a Lighthouse, uses nearestObject ID)
x_sm_type = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client) then {
	d_current_mission_text = "A high ranking enemy government member is visiting Camara Lighthouse. This is a good chance to eliminate him !";
	d_current_mission_resolved_text = "Good job. The government member is dead.";
};

if (isServer) then {
	_officer = switch (d_enemy_side) do {
		case "EAST": {"INS_Commander"};
		case "WEST": {"USMC_Soldier_Officer"};
		case "GUER": {"GUE_Commander"};
	};
	__PossAndOther
	["uaz_grenade", 1, "bmp", 0, "uaz_mg", 1, _pos_other,1,100] spawn XCreateArmor;
	sleep 2.123;
	_building = _poss nearestObject 227121;
	__GetEGrp(_newgroup)
	_sm_vehicle = _newgroup createUnit [_officer, _poss, [], 0, "FORM"];
	[_sm_vehicle] join _newgroup;
	allunits_add set [count allunits_add, _sm_vehicle];
	#ifndef __TT__
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetNormal}];
	#endif
	#ifdef __TT__
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetTT}];
	#endif
	sleep 2.123;
	_bpos = _building buildingPos 1;
	_sm_vehicle setPos _bpos;
	sleep 2.123;
	_leader = leader _newgroup;
	_leader setRank "COLONEL";
	_newgroup allowFleeing 0;
	_newgroup setbehaviour "AWARE";
	_leader disableAI "MOVE";
	sleep 2.123;
	["specops", 2, "basic", 1, _poss,100,true] spawn XCreateInf;
};

if (true) exitWith {};